import App from './App'

import uviewPlus from '@/uni_modules/uview-plus';
import { check_and_login } from '@/common/utils/check';
import http from '@/common/vmeitime-http/interface.js'
import { useConfigStore } from '@/store/index'


// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import pinia from '@/store/index';

export function createApp() {
  const app = createSSRApp(App)
  uni.$check_and_login = check_and_login;
  uni.$defaultCityCode = '310100';
  uni.$defaultPageOutTime = 1500;

  app.use(uviewPlus).use(pinia);

  const configStore = useConfigStore()
  http.init({
    domain: configStore.domain,
    debugDomain: configStore.debugDomain,
    debug: configStore.debug
  })

  return {
    app
  }
}
// #endif